#ifndef RAYLEIGH_ATMOSPHERE_H
#define RAYLEIGH_ATMOSPHERE_H

#include "atmoslayer.h"
class RayleighAtmosphere : public AtmosLayer
{
    Q_OBJECT
public:
    explicit RayleighAtmosphere(QString layerName,
				double hBottom,
				double hTop,
				QObject *parent = 0);
    ~RayleighAtmosphere();
signals:

public slots:

public:
    void RayleighCoeffInit(bool saveTemplate = false);
private:
    void RayleighCoeffCaclulate(bool saveTemplate);
    void upInUpScatCoeffCaculate();
    void upInDownScatCoeffCaculate();
    void downInUpScatCoeffCaculate();
    void downInDownScatCoeffCaculate();

    void coeffCaculate(int scatMode, int lightInputMode);
    void coeffSave(int scatMode);
    void readCoeff(int scatMode);

protected: //functions correspond to caculate procedure
    virtual void upInUpScat();
    virtual void upInDownScat();
    virtual void downInDownScat();
    virtual void downInUpScat();

    void upInUpScatOneDirIn(int iThetaI, int iPhiI);
    void upInDownScatOneDirIn(int iThetaI, int iPhiI);
    void downInDownScatOneDirIn(int iThetaI, int iPhiI);
    void downInUpScatOneDirIn(int iThetaI, int iPhiI);

    virtual void solarScatCoeff(int iThetaS, int iPhiS, linearPolar *lightOut, int scatMode);
    virtual void scatCoeff(int iThetaS, int iPhiS,
			   int iThetaI, int iPhiI,
			   double lightIncident[3],
			   linearPolar *lightOut,
			   int scatMode);

    void scatCaculate(int scatMode);
    void scatCaculate1(int scatMode); //complete same as scatCaculate();

    virtual void downScatInResponse();
protected slots:
	virtual void upInResponse();
};

#endif // RAYLEIGH_ATMOSPHERE_H
